<template>
	<div>
		<!--更多信息弹出层-->
	    <van-popup
		  v-model="showPopup"
		  position="right"
		  :style="{ height: '100%',width:'100%'}"
		>
		    <div style="position: absolute;min-height: 100%;background: #f8f8f8;width: 100%;">
				<van-nav-bar title="分类" > 
				   <van-icon name="arrow-left" slot="left" color="#000" size="20" @click="showPopup=false"/>	
				</van-nav-bar>	
				
				<div class="wrap">
					<div class="li" v-for="(item,index) in list" :key="index" @click="select(item)"> 						
						{{item.categoryName}}
					</div>
				</div>		
			</div>
		</van-popup>
	</div>	
</template>

<script>
import {getFun} from '@/api/publicFun.js'	 
let publicFun=getFun()	
export default {	
	data() {
       return {
       	  url1:this.$api+'/marketorderservice/api/v1/market/category/list',
          showPopup:false,
          list:[]
       }
	},
	methods: {	
	  show(){
	  	this.showPopup=true
	  },
      getData(){
      	 let that=this
	     this.$Axios2.postRequest(this.url1,{}).then(function(res){  
	     	that.list=res.categoryList
	     })	      	
      },
      select(item){
      	this.$emit('selectCategory',item)
      	this.showPopup=false
      }
      
	},
	mixins:[publicFun],//混入		
	mounted() {
		this.getData()
	}
}	
</script>

<style scoped="" lang="scss">
.wrap{padding: 0px 15px 20px;}
.li{padding: 10px 0;border-bottom: 1px solid #E5E5E5;font-size: 13px;color: #333;}

</style>